package service.impl;

import dao.IReaderDao;
import dao.impl.ReaderDao;
import domain.Reader;
import service.IReaderService;

import java.util.List;

public class ReaderService  implements IReaderService {
    IReaderDao readerDao = new ReaderDao();
    //匹配读者
    public boolean login(String workno, String pwd) {
        //1、根据参数查询老师记录
        boolean flag = readerDao.selectReader(workno,pwd);
        //如果教师实例不为空，则信息存在，否则不存在
        return flag;
    }
    //查询读者
    public List selectReaders() {
        return readerDao.selectReaders();
    }

    //添加读者
    public int insertReader(Reader teacher) {
        return readerDao.insertReader(teacher);
    }
    //删除读者
    public String deleteReader(String num){
        return readerDao.deleteReader(num);
    }
    //借阅修改读者借书编号
    public int updateBorrowbook(Reader reader)  {
        return readerDao.updateBorrowbook(reader);
    }
    //归还读者借书编号
    public int returnBorrowbook(Reader reader)  {
        return readerDao.returnBorrowbook(reader);
    }

}
